package com.thememaker.lockstyle.bean.command;

import com.thememaker.lockstyle.bean.ui.BaseView;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import java.util.LinkedHashMap;
import java.util.List;

/**
 * Created by binghui.hang on 2018/2/23.
 * 事件触发器，用来触发命令
 * <Trigger action="" target="" property="" value=""/>
 * 属性：
 * action: 按钮动作： down (按下), up (抬起), double (双击) resume pause 亮暗屏
 * target: 控制目标
 * property: 属性名（目前支持visibility和animation）
 * value: 属性值，目前针对visibility有: true, false, toggle，针对animation有:play
 */
@XmlRootElement(name = "Trigger")
public class Trigger {
    private String action;
    private String target;
    private String property;
    private String value;
    private LinkedHashMap<String, BaseCommand> commandMap;

    @XmlAttribute(name = "action")
    public String getAction() {
        return action;
    }

    @XmlAttribute(name = "target")
    public String getTarget() {
        return target;
    }

    @XmlAttribute(name = "property")
    public String getProperty() {
        return property;
    }

    @XmlAttribute(name = "value")
    public String getValue() {
        return value;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public void setTarget(String target) {
        this.target = target;
    }

    public void setProperty(String property) {
        this.property = property;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @XmlTransient
    public LinkedHashMap<String, BaseCommand> getCommandMap() {
        return commandMap;
    }

    public void setCommandMap(LinkedHashMap<String, BaseCommand> commandMap) {
        this.commandMap = commandMap;
    }
}
